package com.example.httpmessageconvert.httpmessageconvert.controller;

import com.example.httpmessageconvert.httpmessageconvert.enums.SexType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 奶茶
 * Created by on 2018/4/18.
 */
@RestController
public class EnumController {

    /**
     * 接收枚举类型的参数
     * @param sexType
     */
    @RequestMapping(value = "/testEnum",method = RequestMethod.POST)
    public void testEnum(@RequestParam("SexType") SexType sexType){
        System.out.println(sexType.getPrefix());
    }
}
